home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Math / trigHype™ / card_7595.txt < prev    next >
Encoding:
Text File  |  1991-03-17  |  4.1 KB  |  203 lines

  1. -- card: 7595 from stack: in
  2. -- bmap block id: 7986
  3. -- flags: 4000
  4. -- background id: 7184
  5. -- name: a,b,c known
  6. ----- HyperTalk script -----
  7. on mouseUp
  8.   set numberFormat to <0.000000>
  9.  
  10.   --Calculate s
  11.   get card field "Side a"
  12.   put it into mem1
  13.   get card field "Side b"
  14.   put it into mem2
  15.   get card field "Side c"
  16.   put it into mem3
  17.   get (mem1+mem2+mem3)/2
  18.   put it into mem4
  19.   put it into card field "s"
  20.  
  21.   --Calculate K
  22.   get sqrt(((mem4-mem1)*(mem4-mem2)*(mem4-mem3))/mem4)
  23.   put it into mem5
  24.   put it into card field "K"
  25.  
  26.   --Calculate Angle A
  27.   get atan(mem5/(mem4-mem1))*360/pi
  28.   put it into mem6
  29.   put it into card field "angle A"
  30.  
  31.   --Calculate Angle B
  32.   get atan(mem5/(mem4-mem2))*360/pi
  33.   put it into mem7
  34.   put it into card field "angle B"
  35.  
  36.   --Calculate Angle C
  37.   get atan(mem5/(mem4-mem3))*360/pi
  38.   put it into mem8
  39.   put it into card field "angle C"
  40.  
  41.   --Calculate Area
  42.   get (card field "side a"+card field "side b"+card field "side c")/2
  43.   put it into mem9
  44.   get sqrt(mem9*(mem9-card field "side a")*(mem9-card field "side b") *(mem9-card field "side c"))
  45.   put it into bkgnd field "Area"
  46.  
  47.   --Calculate Perimeter
  48.   get card field "side a"+card field "side b"+card field "side c"
  49.   put it into bkgnd field "Perimeter"
  50. end mouseUp
  51.  
  52.  
  53. -- part 2 (field)
  54. -- low flags: 01
  55. -- high flags: 0004
  56. -- rect: left=245 top=82 right=101 bottom=373
  57. -- title width / last selected line: 0
  58. -- icon id / first selected line: 0 / 0
  59. -- text alignment: 1
  60. -- font id: 3
  61. -- text size: 12
  62. -- style flags: 256
  63. -- line height: 16
  64. -- part name: angle B
  65.  
  66.  
  67. -- part 3 (field)
  68. -- low flags: 01
  69. -- high flags: 0004
  70. -- rect: left=299 top=215 right=234 bottom=427
  71. -- title width / last selected line: 0
  72. -- icon id / first selected line: 0 / 0
  73. -- text alignment: 1
  74. -- font id: 3
  75. -- text size: 12
  76. -- style flags: 256
  77. -- line height: 16
  78. -- part name: angle C
  79.  
  80.  
  81. -- part 4 (field)
  82. -- low flags: 01
  83. -- high flags: 0004
  84. -- rect: left=22 top=215 right=234 bottom=150
  85. -- title width / last selected line: 0
  86. -- icon id / first selected line: 0 / 0
  87. -- text alignment: 1
  88. -- font id: 3
  89. -- text size: 12
  90. -- style flags: 256
  91. -- line height: 16
  92. -- part name: angle A
  93.  
  94.  
  95. -- part 5 (field)
  96. -- low flags: 00
  97. -- high flags: 0002
  98. -- rect: left=51 top=137 right=154 bottom=184
  99. -- title width / last selected line: 0
  100. -- icon id / first selected line: 0 / 0
  101. -- text alignment: 1
  102. -- font id: 3
  103. -- text size: 12
  104. -- style flags: 0
  105. -- line height: 16
  106. -- part name: side c
  107.  
  108.  
  109. -- part 6 (field)
  110. -- low flags: 00
  111. -- high flags: 0002
  112. -- rect: left=305 top=146 right=163 bottom=433
  113. -- title width / last selected line: 0
  114. -- icon id / first selected line: 0 / 0
  115. -- text alignment: 1
  116. -- font id: 3
  117. -- text size: 12
  118. -- style flags: 0
  119. -- line height: 16
  120. -- part name: side a
  121.  
  122.  
  123. -- part 7 (field)
  124. -- low flags: 00
  125. -- high flags: 0002
  126. -- rect: left=112 top=263 right=280 bottom=240
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 1
  130. -- font id: 3
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: side b
  135.  
  136.  
  137. -- part 9 (field)
  138. -- low flags: 01
  139. -- high flags: 0001
  140. -- rect: left=406 top=53 right=65 bottom=466
  141. -- title width / last selected line: 0
  142. -- icon id / first selected line: 0 / 0
  143. -- text alignment: 0
  144. -- font id: 3
  145. -- text size: 9
  146. -- style flags: 0
  147. -- line height: 12
  148. -- part name: s
  149.  
  150.  
  151. -- part 10 (field)
  152. -- low flags: 01
  153. -- high flags: 0001
  154. -- rect: left=406 top=66 right=78 bottom=466
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 0
  158. -- font id: 3
  159. -- text size: 9
  160. -- style flags: 0
  161. -- line height: 12
  162. -- part name: K
  163.  
  164.  
  165. -- part contents for card part 6
  166. ----- text -----
  167. 2
  168.  
  169. -- part contents for card part 7
  170. ----- text -----
  171. 3
  172.  
  173. -- part contents for card part 5
  174. ----- text -----
  175. 4
  176.  
  177. -- part contents for card part 9
  178. ----- text -----
  179. 4.500000
  180.  
  181. -- part contents for card part 10
  182. ----- text -----
  183. 0.645497
  184.  
  185. -- part contents for card part 4
  186. ----- text -----
  187. 28.955024
  188.  
  189. -- part contents for card part 2
  190. ----- text -----
  191. 46.567463
  192.  
  193. -- part contents for card part 3
  194. ----- text -----
  195. 104.477512
  196.  
  197. -- part contents for background part 3
  198. ----- text -----
  199. 9.000000
  200.  
  201. -- part contents for background part 5
  202. ----- text -----
  203. 2.904738